<?php

    $app->get("/leos/", function() use($app, $dbUtil)
    {
        echo json_encode(LeoDatabaseHelper::getLeos($dbUtil));
    });
    
    $app->get("/leos/full", function() use($app, $dbUtil)
    {
        echo json_encode(LeoDatabaseHelper::getLeosFull($dbUtil));
    });

    $app->get("/leos/:id", function($id) use ($app, $dbUtil)
    {
        echo json_encode(LeoDatabaseHelper::getLeoByID($dbUtil, $id));
    });
    
    $app->delete("/leos/:id", function($id) use ($app, $dbUtil)
    {
        LeoDatabaseHelper::DeleteLeoByID($dbUtil, $id);
    });
    
    $app->post("/leos/", function() use($app, $dbUtil)
    {
        echo json_encode(LeoDatabaseHelper::createLeo($dbUtil, $app));
    });
    
    $app->put("/leos/:id", function($id) use($app, $dbUtil)
    {
        echo json_encode(LeoDatabaseHelper::updateLeo($id, $dbUtil, $app));
    });
?>
